Rust-Based Monitor Color Reader for Home Assistant Integration

This project is my first exploration into the Rust programming language. It involves an application designed to read the primary color of the monitor and transmit it to specified light bulbs connected to Home Assistant, as specified in the settings.json file.
Usage

    Installation: Clone the repository and compile the Rust code.

bash

git clone https://github.com/your_repository.git
cd your_repository
cargo build --release

    Configuration: Modify the settings.json file to suit your setup.

json

{
    "api_endpoint": "ip/dns",
    "light_entity_names": [
        "light.name1",
        "light.name2",
        "light.name3"
    ],
    "token": "token",  
    "grab_interval": 50,        
    "skip_pixels": 10,          
    "smoothing_factor": 0.0, 
    "monitor_id": 0
}

    api_endpoint: Specify the IP or DNS address for Home Assistant.
    light_entity_names: Provide the names of the light entities to control.
    token: Your Home Assistant token for authentication.
    grab_interval: Interval in milliseconds for color sampling.
    skip_pixels: Number of pixels to skip when sampling colors.
    smoothing_factor: Adjusts color smoothing; set to 0.0 for no smoothing.
    monitor_id: Specify the ID of the monitor to read colors from.

Notes

    Ensure your Home Assistant setup allows API access and communication with the specified entities.
    This application relies on the settings.json file for configuration. Modify it carefully to avoid errors.

Feel free to contribute to or provide feedback on this project! Happy coding in Rust! 🦀🚀
